package com.stx.day0917;

/**
 * packageName com.stx.day0917
 *
 * @author YangYi
 * @className BankAccount
 * @date 2025/9/17
 * @description TODO
 */
public class BankAccount {
    private String accName;
    private double balance;
    private String account;
    private String password;

    int count;//用于银行对你存取钱次数记录
    public final  static int COUNT = 1;

    public void showAccount(String acc){
        if(account == acc) {
            System.out.println("账户姓名：" + accName + "，账号：" + account + "，账户余额：" + balance);
            return;
        }
        System.out.println("账号信息错误");

    }

    public void save(double ba){
        if(ba > 10000){
            System.out.println("存钱超过限制，请分批存储");
            return;
        }
        balance += ba;
    }

    public void fetch(double money,String pwd){
        if(password != pwd){
            System.out.println("密码错误，请重新输入");
            return;
        }
        if(money > balance){
            System.out.println("余额不足");
            return;
        }
        balance -= money;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getAccName() {
        return accName;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public double getBalance() {
        return balance;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
